home *** CD-ROM | disk | FTP | other *** search
- Path: lyra.csx.cam.ac.uk!93heb
- From: 93heb@eng.cam.ac.uk (H.E. Butterworth)
- Newsgroups: comp.lang.c
- Subject: Re: ATTENTION C EXPERTS!! Extern Declarations - NEED HELP!
- Date: 15 Jan 1996 11:49:39 GMT
- Organization: Cambridge University Engineering Department, UK
- Message-ID: <4ddf0j$6mb@lyra.csx.cam.ac.uk>
- References: <4dcl71$94s@enterprise.sct.gu.edu.au>
- NNTP-Posting-Host: tw800.eng.cam.ac.uk
-
- Hi,
-
- IMHO
-
- cdecl and near are compiler flags which tell the compiler to use the c style
- calling convention (as opposed to pascal style) and that the function is near i.e.
- not to reload the segment registers on function entry. The macros _CDECL and
- _NEAR just allow you to remove the flags by defining NO_KEYS.
-
- I have seen these before only in code for the segmented x86 memory model -
- specifically in exported sections of 16 bit Windows DLLs where an exported
- function must be declared far and cdecl - I think the compiler would otherwise
- use the pascal calling convention because it is slightly more efficient. 16 bit
- Windows code has this stuff scattered all over it.
-
- This may be a somewhat garbled version of 'The Truth' but I'm fairly sure
- it's on the right lines.
-
- HB.
-